# 版本号限定 可选
cmake_minimum_required(VERSION 3.0)
# 项目名称
project(02_mRender_core_1)

# 资源文件复制
file(COPY lib/glfw3.dll DESTINATION ./)
# 字体文件
file(COPY resource DESTINATION ./)
# shader
file(COPY shaders DESTINATION ./)

# 源码
aux_source_directory(src SOURCE)
### 基础
aux_source_directory(src/core SOURCE)
### 数学
aux_source_directory(src/math SOURCE)
### 工具
aux_source_directory(src/utils SOURCE)
### 几何体
aux_source_directory(src/matrials SOURCE)
### 材质
aux_source_directory(src/geometries SOURCE)
### 辅助线框
aux_source_directory(src/helpers SOURCE)
### 对象
aux_source_directory(src/objects SOURCE)
### ui
aux_source_directory(src/gui SOURCE)
### 渲染器
aux_source_directory(src/renderer SOURCE)

# 设置包含目录
set(DIR_INCLUDES ${PROJECT_SOURCE_DIR}/include)
include_directories(${DIR_INCLUDES})

# 可执行程序
add_executable(${PROJECT_NAME} ${SOURCE} src/core/Config.cpp)

# 设置需要的链接库
link_directories(${PROJECT_SOURCE_DIR}/lib)
## Imgui
add_library(imgui STATIC
        ${DIR_INCLUDES}/imgui/imgui.cpp
        ${DIR_INCLUDES}/imgui/imgui_impl_glfw.cpp
        ${DIR_INCLUDES}/imgui/imgui_impl_opengl3.cpp
        ${DIR_INCLUDES}/imgui/imgui_draw.cpp
        ${DIR_INCLUDES}/imgui/imgui_demo.cpp
        ${DIR_INCLUDES}/imgui/imgui_tables.cpp
        ${DIR_INCLUDES}/imgui/imgui_widgets.cpp)
target_link_libraries(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/lib/glfw3.dll imgui)